/*
 * @Description:js 数组
 * @Author: admin
 * @Date: 2021-06-07 17:45:48
 * @LastEditors: admin
 * @LastEditTime: 2021-06-07 18:26:41
 */
var arr = ["larry", "terry", "boss"];
// console.log(arr[0]); // larry
// console.log(arr.length);
// console.log(arr[3] = "tom");
// console.log(arr.length);
// console.log(Array.isArray(arr));
// console.log(typeof (arr));
// console.log(arr instanceof Array);
// console.log(arr);
// console.log(arr.toString());
// console.log(arr.join("++"));
// console.log(arr);
// console.log(arr.push("tom")); // 4
// console.log(arr);
// console.log(arr.length); // 4
// console.log(arr.pop()); // tom
// console.log(arr.length); // 3
// console.log(arr);
// console.log(arr.shift()); // larry
// console.log(arr.length); // 2
// console.log(arr);
// console.log(arr.unshift("larry", "tom"));  // 4
// console.log(arr);
// console.log(arr.reverse());
// console.log(arr.sort());

var arr = ["larry", "terry", "boss"];

// var newArr = arr.concat('jerry', 'tom');
// console.log(arr);
// console.log(newArr);
// var newArr = arr.slice(0, 1); //(0,1]
// console.log(newArr);

// var newArr = arr.slice(1); //(1,最后一个）
// console.log(newArr);

// var newArr = arr.splice(0, 1); //"terry", "boss"
// console.log(newArr);
// var a = arr.splice(1, 0, "hello")
// var a = arr.splice(1, 1, "hello")

// console.log(arr);
// var a = arr.splice(1, 0, "hello")
console.log(arr);
var a = arr.splice(0, 1,)
console.log(arr);